import httpRequest from "./httpRequest.js";
/**
 * 请求数据处理
 * @param string url 请求地址
 * @param string method 请求方式
 *  GET or POST
 * @param {*} postData 请求参数
 * @param bool isDelay 是否延迟显示loading
 * @param bool isForm 数据格式
 *  true: 'application/x-www-form-urlencoded'
 *  false:'application/json'
 * @param bool hideLoading 是否隐藏loading
 *  true: 隐藏
 *  false:显示
 * (url, method, postData, isDelay, isForm, hideLoading) 
 */

export default {
	// 验证码登录
	codeLogin: (param = {}) => httpRequest.request("/user/codeLogin", "POST", param, false, false, true),
  // 密码登录
	passLogin: (param = {}) => httpRequest.request("/user/passwordLogin", "POST", param, false, false, true),
	//登录获取验证码
	getCode: (param = {}) => httpRequest.request("/sms/getLoginVerifyCode", "GET", param, false, false, true),
  // 修改密码
	editPass: (param = {}) => httpRequest.request("/user/editPassword", "POST", param, false, false, true),
  // banner
	bannerList: (param = {}) => httpRequest.request("/banner/list", "GET", param, false, false, true),
  // 首页分类
  categoryList: (param = {}) => httpRequest.request("/product/categoryList  ", "GET", param, false, false, true),
	// 绑定公众号openid
	bindAccount: (param = {}) => httpRequest.request("/user/bindAccount", "POST", param, false, false, true),
  //首页商品接口
  homeFindByPage: (param = {}) => httpRequest.request("/product/findByPage", "POST", param, false, false, true),
	//商品详情
	productDetail: (param = {}) => httpRequest.request("/product/detail", "GET", param, false, false, true),
	//商品加入购物车
	shoppingAdd: (param = {}) => httpRequest.request("/shoppingCar/add", "POST", param, false, false, true),
	// 查询当前用户的购物车列表
	shoppingList: (param = {}) => httpRequest.request("/shoppingCar/findByList", "GET", param, false, false, true),
  // 编辑购物车商品数量
  shoppingUpdate: (param = {}) => httpRequest.request("/shoppingCar/update", "POST", param, false, false, true),
	// 删除购物车商品
  shoppingDelete: (param = {}) => httpRequest.request("/shoppingCar/delete", "POST", param, false, false, true),
	// 用户收货地址列表
  myAddress: (param = {}) => httpRequest.request("/userAddress/myAddress", "GET", param, false, false, true),
 // 行政区划接口 三级联动
  areaList: (param = {}) => httpRequest.request("/area/list", "GET", param, false, false, true),
	// 添加收货地址 
  addressAdd: (param = {}) => httpRequest.request("/userAddress/add", "POST", param, false, false, true),
  // 修改收货地址 
  addressUpdate: (param = {}) => httpRequest.request("/userAddress/update", "POST", param, false, false, true),
  // 删除收货地址 
  addressDelete: (param = {}) => httpRequest.request("/userAddress/delete", "POST", param, false, true, true),
	// 创建订单 
  createOrder: (param = {}) => httpRequest.request("/order/createOrder", "POST", param, false, false, true),
  // 订单列表
  orderFindByPage: (param = {}) => httpRequest.request("/order/findByPage", "POST", param, false, false, true),
  // 订单详情
  orderFindById: (param = {}) => httpRequest.request("/order/findById", "GET", param, false, false, true),
  // 取消订单
  cancelOrder: (param = {}) => httpRequest.request("/order/cancelOrder", "POST", param, false, true, true),
  // 未发货直接退款
  orderRefund: (param = {}) => httpRequest.request("/order/refund", "POST", param, false, false, true),
  // 申请退款
  orderApplyRefund: (param = {}) => httpRequest.request("/order/applyRefund", "POST", param, false, true, true),
  // 取消退款 
  orderCancelRefund: (param = {}) => httpRequest.request("/order/cancelRefund", "POST", param, false, true, true),
  // 物流查询
  orderLogistics: (param = {}) => httpRequest.request("/order/logistics", "POST", param, false, false, true),
  // 单商品物流信息查询
  orderProductLogistics: (param = {}) => httpRequest.request("/order/productLogistics", "POST", param, false, false, true),
  //确认收货
  orderConfirmTake: (param = {}) => httpRequest.request("/order/confirmTake", "GET", param, false, false, true),
  // 删除订单
  orderDeleted: (param = {}) => httpRequest.request("/order/deleted", "POST", param, false, false, true),
  // 支付订单
  orderPay: (param = {}) => httpRequest.request("/order/pay", "POST", param, false, false, true),
  // 获取个人信息
  userInformation: (param = {}) => httpRequest.request("/user/information", "GET", param, false, false, true),
  // 修改个人信息
  userEditInformation: (param = {}) => httpRequest.request("/user/information", "POST", param, false, false, true),
  // 上传图片
  uploadImage: (param = {}) => httpRequest.request("/image/upload", "POST", param, false, false, true),
  // 余额购买兜兜卡
  cardBuyCard: (param = {}) => httpRequest.request("/card/buyCard", "POST", param, false, false, true),
  // 生成充值订单
  userCreateCharge: (param = {}) => httpRequest.request("/user/createCharge", "POST", param, false, false, true),
  // 充值支付
  userChargePay: (param = {}) => httpRequest.request("/user/chargePay", "POST", param, false, true, true),
  // 查询当前用户的兜兜卡列表 
  cardFindByList: (param = {}) => httpRequest.request("/card/findByList", "POST", param, false, true, true),
  // 兜兜卡账单 
  cardFindByPage: (param = {}) => httpRequest.request("/bill/card/findByPage", "POST", param, false, false, true),
  // 余额账单 
  userBalanceFlowingFindByPage: (param = {}) => httpRequest.request("/userBalanceFlowing/findByPage", "POST", param, false, false, true),
  // 提现
  userWithdraw: (param = {}) => httpRequest.request("/user/withdraw", "POST", param, false, false, true),
  // 查询认证结果 0未认证 1已认证
  userAuthenticate: (param = {}) => httpRequest.request("/user/authenticate", "POST", param, false, true, true),
  // 获取认证信息
  userBankAuthenticate: (param = {}) => httpRequest.request("/userBank/authenticate", "GET", param, false, false, true),
  // 提交认证信息
  userBankEditAuthenticate: (param = {}) => httpRequest.request("/userBank/authenticate", "POST", param, false, false, true),
  // 查询兜兜卡的流水
  cardBillFlow: (param = {}) => httpRequest.request("/card/bill/flow", "GET", param, false, false, true),
  // 个人 确认回收
  cardBillConfirm: (param = {}) => httpRequest.request("/card/bill/confirm", "POST", param, false, false, true),
  // 根据手机号查询用户信息
  informationByPhone: (param = {}) => httpRequest.request("/user/information/byPhone", "GET", param, false, false, true),
  // 社区店赠送兜兜卡
  cardSendCard: (param = {}) => httpRequest.request("/card/sendCard", "POST", param, false, false, true),
  // 社区店回收兜兜卡
  cardRecycleCard: (param = {}) => httpRequest.request("/card/recycleCard", "POST", param, false, false, true),
  // 分享情况
  userProfitList: (param = {}) => httpRequest.request("/user/profitList", "GET", param, false, false, true),
  // 签到
  userSign: (param = {}) => httpRequest.request("/user/sign", "POST", param, false, true, true),
  // 签到情况
  userSignDetail: (param = {}) => httpRequest.request("/user/sign", "GET", param, false, false, true),
  // 获取用户订单数量
  orderOrderNum: (param = {}) => httpRequest.request("/order/orderNum", "GET", param, false, false, true),
  // 上传凭证
  billEvidence: (param = {}) => httpRequest.request("/card/bill/evidence", "POST", param, false, false, true),
  // 绑定上级邀请码
  userBindParent: (param = {}) => httpRequest.request("/user/bindParent", "POST", param, false, true, true),
  // 获取系统设置 会员等级开关key填mem_rule_show 跑马灯内容key填horse_lamp
  systemSettingsGet: (param = {}) => httpRequest.request("/systemSettings/get", "GET", param, false, false, true),
  // 意见反馈
  feedbackSubmit: (param = {}) => httpRequest.request("/user/feedback/submit", "POST", param, false, false, true),
  // 查询支付结果
  orderGetPayResult: (param = {}) => httpRequest.request("/order/getPayResult", "POST", param, false, true, true),
  // 线上支付购买兜兜卡
  cardOnlineBuyCard: (param = {}) => httpRequest.request("/card/onlineBuyCard", "POST", param, false, false, true),
  // 线上购卡发起支付
  cardOnlineBuyCardPay: (param = {}) => httpRequest.request("/card/onlineBuyCard/pay", "POST", param, false, true, true),
	// 获取历史消息
	getMsg: (param = {}) => httpRequest.request("/chat/getMsg", "POST", param, false, false, true),
	// 获取新消息
	getNewMsg: (param = {}) => httpRequest.request("/chat/getNewMsg", "POST", param, false, true, true),
	// 发送消息
	sendMsg: (param = {}) => httpRequest.request("/chat/sendMsg", "POST", param, false, false, true),

// 原小程序接口

//首页数据
 miniHomePage: (param) => httpRequest.request(`/homePage/index`,"POST", param, false, false, true, false),
//商品分页 搜索结果
 miniFindByPage: (param) => httpRequest.request(`/product/findByPage`,"POST", param,false, false, true, false),
//搜索关键字
miniSearchKey: (param) => httpRequest.request(`/homePage/searchKey`,"GET", param,false, false, true, false),
// 添加收藏 
miniAddCollet: (param) => httpRequest.request(`/user/addCollet`,"POST", param,false, true, true, false),
// 取消收藏 
miniCancelCollet: (param) => httpRequest.request(`/user/cancelCollet`,"POST", param,false, true, true, false),
//商品详情
miniProductDetail: (param) => httpRequest.request(`/product/detail`,"POST", param,false, true, true, false),
//评价列表
miniFindEvaluateByPage: (param) => httpRequest.request(`/product/findEvaluateByPage`,"POST", param,false, false, true, false),
//商品加入购物车
miniAdd2ShoppingCar: (param) => httpRequest.request(`/shoppingCar/add2ShoppingCar`,"POST", param,false, false, true, false),
//分类列表
miniAssortList: (param) => httpRequest.request(`/product/assortList`,"GET", param,false, false, true, false),
//我的收藏
miniMyCollet: (param) => httpRequest.request(`/user/myCollet`,"POST", param,false, false, true, false),
//收货地址列表
miniMyAddress: (param) => httpRequest.request(`/address/myAddress`,"GET", param,false, false, true, false),
//默认收货地址
miniDefaultAddress: (param) => httpRequest.request(`/address/defaultAddress`,"GET", param,false, false, true, false),
//添加收货地址
miniAddAddress: (param) => httpRequest.request(`/address/addAddress`,"POST", param,false, false, true, false),
//修改收货地址
miniUpdateAddress: (param) => httpRequest.request(`/address/updateAddress`,"POST", param,false, false, true, false),
//删除收货地址
miniDeleteAddress: (param) => httpRequest.request(`/address/deleteAddress`,"POST", param,false, true, true, false), 
//商品规格列表
miniProductSpecs: (param) => httpRequest.request(`/product/productSpecs`,"GET", param,false, false, true, false),
//创建订单
miniCreateOrder: (param) => httpRequest.request(`/order/createOrder`,"POST", param,false, false, true, false),
//发起支付
miniOrderPay: (param) => httpRequest.request(`/order/pay`,"POST", param,false, true, true, false),
	//订单列表 分页
miniOrderFindByPage: (param) => httpRequest.request(`/order/findByPage`,"POST", param,false, false, true, false),
//我的购物车
miniMyCar: (param) => httpRequest.request(`/shoppingCar/myCar`,"GET", param,false, false, true, false),
//购物车数量修改
miniUpdateShoppingCar: (param) => httpRequest.request(`/shoppingCar/updateShoppingCar`,"POST", param,false, false, true, false),
//商品删除购物车
miniDeleteShoppingCar: (param) => httpRequest.request(`/shoppingCar/deleteShoppingCar`,"POST", param,false, false, true, false),
//获取个人信息
miniGetUserInfo: (param) => httpRequest.request(`/user/getUserInfo`,"GET", param,false, false, true, false),
//修改个人信息
miniUpdateUserInfo: (param) => httpRequest.request(`/user/updateUserInfo`,"POST", param,false, false, true, false),
//最近的店铺列表
miniStoreList: (param) => httpRequest.request(`/homePage/storeList`,"GET", param,false, false, true, false),
//订单详情
miniOrderDetail: (param) => httpRequest.request(`/order/detail`,"GET", param,false, false, true, false),
//物流信息查询
miniLogistics: (param) => httpRequest.request(`/order/logistics`,"GET", param,false, false, true, false),
//待发货直接退款
miniOrderRefund: (param) => httpRequest.request(`/order/refund`,"GET", param,false, false, true, false),
//申请退款
miniApplyRefund: (param) => httpRequest.request(`/order/applyRefund`,"GET", param,false, false, true, false),
//取消退款
miniCancelRefund: (param) => httpRequest.request(`/order/cancelRefund`,"GET", param,false, false, true, false),
//确认收货
miniConfirmTake: (param) => httpRequest.request(`/order/confirmTake`,"GET", param,false, false, true, false),
//评价列表
miniFindEvaluateByPage: (param) => httpRequest.request(`/product/findEvaluateByPage`,"POST", param,false, false, true, false),
//各个评论数量 好评 中评 差评
miniEvaluateNum: (param) => httpRequest.request(`/product/evaluateNum`,"GET", param,false, false, true, false),
//取消订单
miniCancelOrder: (param) => httpRequest.request(`/order/cancelOrder`,"GET", param,false, false, true, false),
//评价订单
miniEvaluate: (param) => httpRequest.request(`/order/evaluate`,"POST", param,false, false, true, false),
//订单数量
miniOrderNum: (param) => httpRequest.request(`/order/orderNum`,"GET", param,false, false, true, false),

//登陆
miniLogin: (param) => httpRequest.request(`/user/phoneAndCodeLogin`,"POST", param,false, false, true, false),

}
